package com.fcl.oschina.util;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

/**
 * Created by Administrator on 2017/3/20.
 */

public class HttpUtil {

    public static String getResult(InputStream is) {
        StringBuilder builder = new StringBuilder();
        try {
            //设置读取数据的格式
            BufferedReader reader = new BufferedReader(new InputStreamReader(is, "utf-8"));
            String line = "";
            while ((line = reader.readLine()) != null) {
                builder.append(line);
            }
            reader.close();
        } catch (Exception e) {
            e.printStackTrace();
        }

        return builder.toString();
    }
}
